package com.oromwin.repos.common;

import org.apache.commons.logging.Log;

public class ReposWarning extends ReposException {
    private static final long serialVersionUID = -9213755783378223503L;
    
    public ReposWarning(Exception e) {
        super(e);
    }
    
    public ReposWarning(String msg) {
        super(msg);
    }
    
    public static ReposWarning create(Log log, Exception e) {
        return create(log, e, "");
    }

    public static ReposWarning create(Log log, String message) {
        ReposWarning e = new ReposWarning(message);
        Logger.errorWithThrowable(log, e, message);
        return e;
    }

    public static ReposWarning create(Log log, Exception e, String message) {
        Logger.errorWithThrowable(log, e, message);
        if (e instanceof ReposException) {
            return (ReposWarning) e;
        }
        return new ReposWarning(e);
    }
}

